import 'element-ui/lib/theme-chalk/index.css';
import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import router from "@pl/router"
import store from "@pl/vuex-store"
import '@css/app.css'
import '@css/login.css'

Vue.use(ElementUI);

router.beforeEach((to, from, next) => {
	// let {
	// 	isLogin,
	// 	isAdmin,
	// } = store.getters;

	// 没有登录直接跳转首页
	// if (!isLogin && to.path != "/login")
	// 	return next("/login");

	// // if (to.path == '/modifypwd')
	// // 	return next();

	// // 登录后默认跳转主页
	// if (isLogin && (to.path == "/login" || to.path == '/'))
	// 	return next("/index");

	if (to.path == "/")
		return next("/login");

	return next();
});

export default new Vue({
	el: "#app",
	store,
	router,
	template: "<App/>",
	components: {
		App
	},
	beforeCreate() {

	},
	render: h => h(App)
});